<template>
  <div class="judgeCard">
    <a :href="props.cardItem.link" target="_blank">
      <div class="imgBox">
        <img :src="props.cardItem.img" :alt="props.cardItem.name" />
      </div>
      <div class="info">
        <div class="title">{{ props.cardItem.name }}</div>
        <div class="author">
          <span>{{ props.cardItem.author }}</span>
          <span>{{ props.cardItem.time }}</span>
        </div>
        <div class="introduce">
          {{ props.cardItem.introduce }}
        </div>
        <div class="tags">
          <span v-for="(i, index) in props.cardItem.tags" :key="index">{{
            i
          }}</span>
        </div>
      </div>
      <div class="score">
        <span>{{ props.cardItem.Bscore }}</span>
        <i>{{ props.cardItem.Sscore }}</i>
      </div>
    </a>
  </div>
</template>

<script setup>
const props = defineProps({
  cardItem: Object,
});
</script>

<style scoped lang="less">
.judgeCard {
  flex: 1;
  margin-top: 20px;
  a {
    background-color: #fff;
    box-shadow: 0 3px 6px 0 rgb(0 0 0 / 10%);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    transition: all 0.1s ease;
    .imgBox {
      width: 140px;
      height: 185px;
      img {
        width: 100%;
        height: 100%;
        border-radius: 20px;
      }
    }
    .info {
      flex: 1;
      display: flex;
      flex-direction: column;
      margin-left: 20px;
      .title {
        font-size: 16px;
        font-weight: bold;
        height: 30px;
        line-height: 30px;
      }
      .author {
        color: #b1b1b1;
        font-size: 14px;
        overflow: hidden;
        height: 25px;
        line-height: 25px;
        margin-bottom: 10px;
        span {
          margin-right: 10px;
        }
      }
      .introduce {
        height: 60px;
        width: 100%;
        overflow: hidden;
        line-height: 20px;
        font-size: 14px;
      }
      .tags {
        height: 25px;
        margin-top: 10px;
        overflow: hidden;
        width: 100%;
        span {
          float: left;
          background-color: #efefef;
          border-radius: 13px;
          height: 25px;
          line-height: 25px;
          padding: 0 10px;
          color: #414141;
          font-size: 12px;
          margin-right: 5px;
        }
      }
    }
    .score {
      position: absolute;
      top: 9px;
      right: 9px;
      width: 47px;
      height: 47px;
      color: #ff4e00;
      font-weight: bold;
      line-height: 33px;
      text-align: center;
      box-sizing: border-box;
      border-radius: 50%;
      border: solid 7px #ffeade;
    }
    &:hover {
      transform: scale(1.1);
    }
  }
}
</style>
